package com.example.blog_system_ssm.mapper;

import com.example.blog_system_ssm.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    public List<ArticleInfo> getMyList(@Param("uid") Long uid,@Param("psize") Integer psize,@Param("offset") Integer offset);

    public ArticleInfo getDetail(@Param("aid") Long aid);

    public int update(@Param("aid") Long aid, @Param("uid") Long uid, @Param("title") String title, @Param("content") String content);

    public int delete(@Param("aid") Long aid, @Param("uid") Long uid);

    public int add(@Param("uid") Long uid,@Param("aid") Long aid,@Param("title") String title,@Param("content") String content);

    public int getTotalCount();
    public int getMyTotalCount(Long uid);

    public List<ArticleInfo> getList(@Param("psize") Integer psize,@Param("offset") Integer offset);

    public List<Long> getAllId();
    public int incrNumById(@Param("aid")Long aid,@Param("incr") Integer incr);
    public int incrArticleCount(@Param("uid") Long uid,@Param("var") Integer var);
}
